from kivy.app import App
from kivy.uix.button import Button
import requests
import sys


def callback(instance):
    print('The button <%s> is being pressed' % instance.text)
    # x = requests.get('http://lab.tqzgc.com')
    # print(x.text)
    sys.exit(0)


class TestApp(App):
    def build(self):
        button = Button(text='获取源码', font_size=30, size=(30, 20), font_name='fonts/牵牛花绕青藤.ttf')
        button.bind(on_press=callback)
        button.width = 200
        button.background_color = [125, 200, 0, 0.5]
        button.color = [255, 50, 50, 1]
        print(button.color)
        return button


app = TestApp()
app.run()
